﻿<Windows:BookvarToolWindow
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:aw="clr-namespace:Assergs.Windows;assembly=Assergs.Windows"
	xmlns:converters="clr-namespace:Bookvar.UI.Converters;assembly=Bookvar.UI"
  xmlns:ui="clr-namespace:Bookvar.UI;assembly=Bookvar.UI"
	xmlns:bObjectModel="clr-namespace:Bookvar.ObjectModel;assembly=Bookvar.ObjectModel"
	xmlns:local="clr-namespace:BookvarWpf.Windows"
	xmlns:controls="clr-namespace:BookvarWpf.Controls"
	xmlns:Windows="clr-namespace:BookvarWpf.Windows;assembly="
  xmlns:r="clr-namespace:Bookvar.UI.Localization;assembly=Bookvar.UI"
	x:Class="BookvarWpf.Windows.PublishMap"
	Header="{r:Resources PublishMapHeaderText}"
	Icon="pack://application:,,,/BookvarWPF;component/Resources/Icons/16x16/Publish16.png"
	Style="{DynamicResource {x:Type aw:ToolWindow}}"
	Background="{StaticResource ListBackground}"
	Width="400" Height="364"
	>
  <aw:ToolWindow.Resources>
    <ResourceDictionary>
      <DataTemplate x:Key="ListNamesTemplate">
        <TextBlock Text="{Binding Path=Name, Mode=Default}" />
      </DataTemplate>
    </ResourceDictionary>
  </aw:ToolWindow.Resources>
  <Grid>
    <Grid.Resources>
      <converters:NullToBooleanConverter x:Key="nullToBool" />
      <Style TargetType="{x:Type TextBox}">
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="BorderThickness" Value="0,0,0,0" />
        <Setter Property="Margin" Value="2,2,2,2" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Width" Value="150" />
      </Style>

      <Style TargetType="{x:Type Border}">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="BorderBrush" Value="#FF85A7DB" />
        <Setter Property="Background" Value="#FFF0F7FF" />
        <Setter Property="CornerRadius" Value="5,5,5,5" />
        <Setter Property="Margin" Value="2,2,2,2" />
        <Setter Property="Height" Value="24" />
        <Setter Property="BorderThickness" Value="1,1,1,1" />
      </Style>

      <Style TargetType="{x:Type Label}">
        <Setter Property="FontFamily" Value="Verdana" />
        <Setter Property="FontSize" Value="18" />
        <Setter Property="Foreground" Value="#FFFFFFFF" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
      </Style>
    </Grid.Resources>
    <StackPanel Orientation="Vertical" x:Name="listsPanel" Visibility="Collapsed" IsEnabled="True" >
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="244" />
          <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Grid.Column="0" Grid.Row="0">
          <Label Content="Lists" Margin="10,0,0,0" />
          <Border Margin="10,6,15,6" >
            <TextBox x:Name="txtFileName" Width="240" TextWrapping="Wrap" TextAlignment="Left" 
                     HorizontalAlignment="Left" VerticalAlignment="Top"/>
          </Border>
          <Border Margin="10,6,15,6" Height="204">
            <ListBox x:Name="listNames" ItemTemplate="{StaticResource ListNamesTemplate}" Width="240" Height="200" Background="Transparent"
               HorizontalAlignment="Left" Margin="2,2,2,2" VerticalAlignment="Top" BorderThickness="0,0,0,0" />
          </Border>
        </StackPanel>
        <StackPanel Grid.Column="1" Grid.Row="0" Orientation="Vertical" x:Name="tagsPanel" Visibility="Collapsed" Margin="5,5,5,5">
          <Label FontSize="16" Content="{r:Resources PublishMapTagsText}" />
          <Border>
            <TextBox x:Name="txtTags" TextWrapping="Wrap" />
          </Border>
          <Border Height="134">
            <ui:TagCloud x:Name="TagCloudControl" GroupDescriptor="Name" SortDescriptor="Name"
                         TagSelectionChanged="TagCloudControl_TagSelectionChanged" MaxHeight="130" />
          </Border>
        </StackPanel>
      </Grid>
      <StackPanel Orientation="Horizontal">
        <Button Width="75" HorizontalAlignment="Center" VerticalAlignment="Center" 
                Click="OnPublishClicked" Margin="10,2,15,2" IsDefault="True" 
                IsEnabled="{Binding Path=SelectedItem, ElementName=listNames, Converter={StaticResource nullToBool}}"
                Height="22" BorderBrush="#FF536B88" Background="{StaticResource BlueButtonStyleBrush}"
                Content="{r:Resources PublishMapPublishText}" />
        <Button Width="75" HorizontalAlignment="Center" VerticalAlignment="Center"
                Margin="10,2,15,2" Command="aw:ToolWindow.CloseCommand" IsCancel="True"
                Height="22" BorderBrush="#FF536B88" Background="{StaticResource BlueButtonStyleBrush}"
                Content="{r:Resources PublishMapCancelText}" />
      </StackPanel>
    </StackPanel>
    <controls:ProgressAnimation x:Name="progressAnimation" />
  </Grid>
</Windows:BookvarToolWindow>